{% extends "panel/panel_base.html" %}
{% load socialgraph %}
{% block panel_title%}Search Users:{% endblock %}
{% block panel_content %}
	<form action="http://fblaconnection.com/panel/search/" method="get" accept-charset="utf-8">
		<table width="450" border="0">
			<tr>
				<td align="right">Search:</td>
				<td><input type="text" name="q" value="{{query_string}}" class="register_text populate" title="Search...." /></td>
				<td wdith="200">By: 
					<select value="by" name="by">
					  <option value="1" {% ifequal by "1" %}selected{%endifequal%}>First Name</option>
					  <option value="2" {% ifequal by "2" %}selected{%endifequal%}>Last Name</option>
					  <option value="3" {% ifequal by "3" %}selected{%endifequal%}>Email</option>
					</select>
				</td>
				<td>
						<input type="submit" class="register_button" value="Search">
				</td>
			</tr>
		</table>
	</form>
	{% if search %}
	{% if found_entries %}
	<div id="search_box">
	{% for q in found_entries %}
	<br />
		<span id="search_res">Name: <a class="search_res" href="http://fblaconnection.com/panel/{{q.username}}/userp/">
			{{q.first_name}}  {{q.last_name}} - Grade: 
			{% ifequal q.get_profile.grade 9 %}Freshman{% endifequal %}
			{% ifequal q.get_profile.grade 10 %}Sophomore{% endifequal %}
			{% ifequal q.get_profile.grade 11 %}Junior{% endifequal %}
			{% ifequal q.get_profile.grade 12  %}Senior{% endifequal %}
			{% ifequal q.get_profile.grade 13 %}Graduated{% endifequal %}<br />
		Username: {{q}}<br /> Email: {{q.email}}</a><br />
		<a href="http://fblaconnection.com/panel/{{request.user.username}}/messages/send/?user={{q.username}}">Message</a> | 
		<a href="http://fblaconnection.com/panel/{{q.username}}/gallery/">Gallery</a> | 
		<a href="http://fblaconnection.com/panel/{{request.user.username}}/socialgraph/follow/?ex={{q|is_following:request}}&user={{q.username}}">{{q|is_following_text:request}}</a>
		</span>
		<br /><br />
		<div id="search_box_border"></div>
	{% endfor %}
	</div>
	{% else %}
	No Results Found
	{% endif %}
	{% else %}
	Please enter something to search...
	{% endif %}
{% endblock %}